<?php
session_start();
error_reporting(E_ERROR | E_WARNING | E_PARSE);
include 'includes/header.php';
my_header('Казина :: Jwakk');
?>

        <div class="line"></div>
        <div class="mainConteiner">

           <?php include 'includes'.DIRECTORY_SEPARATOR.'top.php'; ?>
            <div class="topDelimiter"></div>

            <div class="content">

                <table cellspacing="0" cellpadding="0" width="100%"><tr>

                        <td class="Mainmenu" valign="top">
                            <a href="index.php"><div class="manuB">Казина</div></a>
                            <a href="buyCasino.php"><div class="manuB">Купи казино</div></a>
                            <a href="yoursC.php"><div class="manuOnB">Твои казина</div></a>
                            <a href="fight.php"><div class="manuB">Сбий се</div></a>
                            <a href="work.php"><div class="manuB">Работа</div></a>
                            <a href="zalozi.php"><div class="manuB">Залози</div></a>
                            <a href="coffee.php"><div class="manuB">Градът</div></a>
                            <a href="profile.php?user=<?php echo $_SESSION['user_info']['user']; ?>"><div class="manuB">Профил</div></a>
                            <?php
								$mes_q = mysql_query('SELECT id FROM message WHERE `do`="'.$_SESSION['user_info']['user'].'" AND `read`="0"');
								$mes_n = mysql_num_rows($mes_q);
								echo '<a href="mail.php"><div class="manuB">Съобщения ['.$mes_n.']</div></a>';
							?>
                            <a href="index.php?logout"><div class="manuBLogOut">Изход</div></a>

                            <br/>
                            <a href="#"><img alt="Последвайте Jwakk в Facebook" src="img/facebook.png" /></a>
                            <a href="#"><img alt="Последвайте Jwakk в Twitter" src="img/twitter.png" /></a>
                            <a href="#"><img alt="Абонирайте се за RSS емисии" src="img/rss.png" /></a>
                        </td>

                        <td valign="top">
                            <div class="gameBorder">
                                <div class="TheGame">

                                   
                                    <div class="gameTitle">Мои казина</div>
                                    
                                    <div id="casinoNavigate">
									<br/>
                                        
                                    </div>
                                    <table width="100%" class="rankingTable" cellpadding="0"cellspacing="1">

                                        <tr><td class="mainrang" align="center">#</td> <td class="miancasinoNameTalbe">Име</td> <td class="mainfav">В любими</td></tr>
                                        <div class="tableCarino">
                                            <?php
												$i=0;
                                                $mycasino_q = mysql_query('SELECT casino_id,name FROM casino WHERE `by`="'.$_SESSION['user_info']['user'].'" ORDER BY date DESC');
                                                while($mycasino_f = mysql_fetch_assoc($mycasino_q)){
												$i++;
													$howfavourite_q = mysql_query('SELECT COUNT(*) as cnt FROM casino_favourite WHERE casino_id="'.$mycasino_f['casino_id'].'"');
                                                    $howfavourite_f = mysql_fetch_assoc($howfavourite_q);
                                                    echo '<tr><td class="rang" align="center">'.$i.'</td> <td class="casinoNameTalbe"><a href="#">'.$mycasino_f['name'].'</a></td> <td class="fav">'.$howfavourite_f['cnt'].'</td></tr>';
                                                }
                                            ?>
						
                                        </div>
                                    </table>

                                    <div class="padination">
                                        <br/>
                                        <i>Страници:</i> <a href="#">1</a> <a href="#">2</a> <span href="#">3</span> <a href="#">4</a> <a href="#">5</a> <i>....</i> <a href="#">22</a> 
                                    </div>

                                </div>
                            </div>

                            <div class="help"> <a href="#">Помощ</a> | <a href="#">FAQ</a> | <a href="#">Условия</a> | <a href="#">Facebook</a></div>
                        </td>

                    </tr></table>

               
                <?php footer(); ?>
            </div>
        </div>

        <div class="bottom"></div>

    </body>
</html>